-
Notifications
You must be signed in to change notification settings - Fork 132
#215 - Add support for EntityCallbacks #397
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
We now support entity callbacks for: * AfterConvertCallback * BeforeConvertCallback * BeforeSaveCallback * AfterSaveCallback through R2dbcEntityTemplate.
Simplify what's new section.
src/main/java/org/springframework/data/r2dbc/core/R2dbcEntityTemplate.java
Show resolved
Hide resolved
| Invoked before a domain object is converted to `OutboundRow`. | ||
| `Ordered.LOWEST_PRECEDENCE` | ||
|
||
| AfterConvertCallback |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find the naming of BeforeConvertCallback
and AfterConvertCallback
highly confusing.
The names suggests that they happen relative to the same process, one before and one after, while in fact they are completely unrelated.
I think AfterLoadCallback
would be a much better name for the AfterConvertCallback
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AfterLoad
is typically used before converting objects into an entity. We should rather stick to this convention for consistency across our modules.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm. I don't think we are doing it this way in Spring Data JDBC.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then we should align JDBC to the other stores so we can later on introduce a AfterLoad
event/callback that gives users a chance to react to values before materializing an object.
src/main/java/org/springframework/data/r2dbc/core/R2dbcEntityTemplate.java
Outdated
Show resolved
Hide resolved
src/main/java/org/springframework/data/r2dbc/core/R2dbcEntityTemplate.java
Outdated
Show resolved
Hide resolved
src/main/java/org/springframework/data/r2dbc/core/R2dbcEntityTemplate.java
Show resolved
Hide resolved
Reintroduce deprecated setBeanFactory(…) method. Extract code into methods. Ensure that versioned entities are eagerly initialized to allow retries.
That's polished, merged and backported. |
aarg, wrong PR. |
We now support entity callbacks for: * AfterConvertCallback * BeforeConvertCallback * BeforeSaveCallback * AfterSaveCallback through R2dbcEntityTemplate. Original pull request: #397.
Simplify what's new section. Original pull request: #397.
Reintroduce deprecated setBeanFactory(…) method. Extract code into methods. Ensure that versioned entities are eagerly initialized to allow retries. Original pull request: #397.
Formatting. Original pull request: #397.
Now, it's merged and polished. |
We now support entity callbacks for:
AfterConvertCallback
BeforeConvertCallback
BeforeSaveCallback
AfterSaveCallback
through
R2dbcEntityTemplate
.Related ticket: #215.